1. Field of the Invention
The present invention relates to a method for processing audio-video data, and more particularly, to a method for writing, real-time playing, and repairing audio-video data and audio-video files.
2. Related Art
With the development of technology nowadays, audio-video multimedia has been widely used for either entertainment or utility. Video or audio data is indispensable either in movie, advertisement, environment security monitoring system or in medical surgery camera system. The audio-video media is developed to have various file formats, among which the most commonly seen package format is an index-based file format. The package format of the index-based audio-video file mostly has three portions, namely a header, a body, and an index. The portion of the header records basic information of the file, the portion of the body records actual content of the audio-video data, and the portion of the index records a position where the content of the audio-video data is stored in the body.
The index-based file format includes, for example, an audio video interleave (AVI) format developed by Microsoft Corporation and a Third Generation Presence (3GP) format mainly applied on portable electronic devices. The index-based package format is compatible with various standards of the audio-video data such as moving picture experts group (MPEG), motion joint photographic experts group (MJPG), or advanced audio coding (AAC), and thus is widely used in the field of audio-video multimedia. However, when the data is written to form the file, the index is finally written. That is to say, the index cannot be written until the header and the body are completely written into the audio-video file. However, when the index-based file is being played, the audio-video information in the body should be read through the content of the index. Thus, the index-based file cannot be played before being completely written and packaged as a complete file. Being limited by such a structure, the file of index-based format has the problem of failing to play before the file is completely written. In other words, the problem of failing to record and play at the same time and realize the record-and-play function exists.
In addition, if the index-based audio-video file is damaged by an unexpected interrupt during the process of forming the file, the whole audio-video file cannot be used. If the audio-video data and index located at the end of the file have not been written or not completely written, the file cannot be played. Such a kind of incomplete file cannot be repaired, so that the previously captured audio-video data is all in vain.